# !/usr/bin/env python3
# -*- coding: utf-8 -*-
# aim:    
# author: wangkaixuan
# email:  26554189525@qq.com 
# date:   2018/1/10

import mysql.connector
conn = mysql.connector.connect(user = 'iroan',password = 'iroanMYS47',database = 'mysql')
cursor = conn.cursor()
# cursor.execute('create table user(id varchar(20) primary key,name varchar(20))')
# cursor.execute('insert into user_test(id,name) values (%s,%s)',('2','wangkai'))
# print('rowcount =',cursor.rowcount)
# conn.commit()
# cursor.close()
#
# cursor = conn.cursor()
cursor.execute('select * from user_test where id = %s',('2',))
print(cursor.fetchall())
cursor.close()
conn.close()